/* 全局样式 */
body {
	margin: 0;
	padding: 20px;
	font-family: system-ui, -apple-system, sans-serif;
	line-height: 1.5;
	height: 100vh;
	box-sizing: border-box;
}

/* 主容器 */
.container {
	display: flex;
	gap: 20px;
	height: 100%;
}

/* 左侧面板 */
.left-panel {
	flex: 1;
	max-width: 300px;
	background: white;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	display: flex;
	flex-direction: column;
	gap: 20px;
	overflow-y: auto;
}

.settings-section {
	border-bottom: 1px solid #eee;
	padding-bottom: 20px;
}

.settings-section:last-child {
	border-bottom: none;
}

.settings-section h3 {
	margin: 0 0 15px 0;
}

.param-item {
	margin-bottom: 15px;
}

.param-item:last-child {
	margin-bottom: 0;
}

.param-item label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
}

.param-item input, .param-item textarea {
	width: 100%;
	padding: 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-sizing: border-box;
}

.param-item textarea {
	height: 100px;
	resize: vertical;
}

/* 右侧面板 */
.right-panel {
	flex: 3;
	display: flex;
	flex-direction: column;
	background: white;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 聊天容器 */
.chat-container {
	flex: 1;
	overflow-y: auto;
	margin-bottom: 20px;
	border: 1px solid #eee;
	border-radius: 4px;
	padding: 10px;
}

.message {
	margin-bottom: 10px;
	padding: 10px;
	border-radius: 4px;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.user-message {
	background: #e3f2fd;
	margin-left: 20%;
}

.assistant-message {
	background: #f5f5f5;
	margin-right: 20%;
}

/* 输入区域 */
.input-container {
	display: flex;
	gap: 10px;
}

#prompt {
	flex: 1;
	height: 80px;
	padding: 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	resize: vertical;
}

/* 按钮样式 */
button {
	padding: 8px 16px;
	border: none;
	border-radius: 4px;
	background: #0066cc;
	color: white;
	cursor: pointer;
}

button:hover {
	background: #0052a3;
}

button:disabled {
	background: #cccccc;
	cursor: not-allowed;
}

#stop {
	background: #dc3545;
}

#stop:hover {
	background: #c82333;
}

.button-group {
	display: flex;
	gap: 10px;
}

/* 输出区域样式 */
#output {
	white-space: pre-wrap;
	padding: 16px;
	background: #f5f5f5;
	border-radius: 4px;
	min-height: 200px;
}

/* 参数配置区域 */
.params-container {
	margin-bottom: 20px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 10px;
}

.param-item {
	display: flex;
	flex-direction: column;
}

.param-item label {
	margin-bottom: 5px;
}

.param-item input {
	padding: 4px 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
}

/* Markdown 样式优化 */
.assistant-message {
	background: #f5f5f5;
	margin-right: 20%;
}

.assistant-message pre {
	background: #f8f9fa;
	padding: 1em;
	border-radius: 4px;
	overflow-x: auto;
}

.assistant-message code {
	background: #f8f9fa;
	padding: 0.2em 0.4em;
	border-radius: 3px;
	font-size: 0.9em;
}

.assistant-message table {
	border-collapse: collapse;
	width: 100%;
	margin: 1em 0;
}

.assistant-message th,
.assistant-message td {
	border: 1px solid #ddd;
	padding: 8px;
	text-align: left;
}

.assistant-message th {
	background-color: #f8f9fa;
} 